<!doctype html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">

	<head>
		<meta charset="UTF-8">
		<title>管理员列表</title>
		<meta name="renderer" content="webkit">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
        <base href="http://localhost:8080"/>
		<link rel="stylesheet" href="css/font.css">
		<link rel="stylesheet" href="css/weadmin.css">
<!--        <link rel="stylesheet" href="lib/layui/css/layui.css" media="all">-->
	</head>

	<body>
		<div class="weadmin-nav">
			<span class="layui-breadcrumb">
        <a href="">首页</a>
        <a href="">管理员管理</a>
        <a>
          <cite>管理员列表</cite></a>
      </span>
			<a class="layui-btn layui-btn-sm" style="margin-top:3px;float:right" href="javascript:location.replace(location.href);" title="刷新">
				<i class="layui-icon layui-icon-refresh"></i></a>
		</div>
		<div class="weadmin-body">
			<div class="layui-row">
				<form class="layui-form layui-col-md12 we-search" method="get" action="/admin/user/list">
					<div class="layui-inline">
						<input class="layui-input" placeholder="开始日" name="startDate" id="start">
					</div>
					<div class="layui-inline">
						<input class="layui-input" placeholder="截止日" name="endDate" id="end">
					</div>
					<div class="layui-inline">
						<input type="text" name="keyword" placeholder="请输入关键词" autocomplete="off" class="layui-input">
					</div>
					<input class="layui-btn"  type="submit" value="搜索"/>
				</form>
			</div>
			<div class="weadmin-block">
				<button class="layui-btn layui-btn-danger" onclick="delAll()"><i class="layui-icon layui-icon-delete"></i>批量删除</button>
				<button class="layui-btn" onclick="WeAdminShow('添加用户','pages/admin/add.html')"><i class="layui-icon layui-icon-add-circle-fine"></i>添加</button>
                <span class="fr" style="line-height:40px" >共有数据：<span id="dataCount">[[${adminUsers.size()}]]</span> 条</span>
			</div>
			<table class="layui-table">
				<thead>
					<tr>
						<th>
							<div class="layui-unselect header layui-form-checkbox" lay-skin="primary">
                <i class="layui-icon layui-icon-ok"></i>
              </div>
						</th>
						<th>用户名</th>
						<th>昵称</th>
						<th>等级</th>
						<th>角色</th>
						<th>加入时间</th>
						<th>状态</th>
						<th>操作</th>
				</thead>
				<tbody>
                <!-- 展示页面 -->
                <div id="laypage">
                <tr th:each="user:${adminUsers}">
						<td>
							<div class="layui-unselect layui-form-checkbox" lay-skin="primary" th:data-id="${user.id}">
								<i class="layui-icon layui-icon-ok"></i>
							</div>
						</td>
						<td th:text="${user.username}">用户名</td>
						<td th:text="${user.name}">昵称</td>
						<td th:text="${user.level}">权限等级</td>
						<td th:text="${user.role}">角色</td>
						<td th:text="${user.createDate}">创建时间</td>
                        <td>
							<span class="layui-btn layui-btn-normal layui-btn-xs" th:if="${user.status} == 1">已启用</span>
							<span class="layui-btn layui-btn-warning layui-btn-xs" th:if="${user.status} == 0">待审核</span>
<!--                            <input type="checkbox" name="zzz" class="layui-unselect layui-form-switch layui-form-onswitch" />-->
                        </td>
						<td class="td-manage">
							<a th:if="${user.status == 0}" th:data-id="${user.username}" onclick="member_stop(this,this.getAttribute('data-id'))" href="javascript:;" title="启用">
								<i class="layui-icon layui-icon-upload-circle"></i>
							</a>
                            <a th:if="${user.status == 1}" th:data-id="${user.username}" onclick="member_stop(this,this.getAttribute('data-id'))" href="javascript:;" title="停用">
                                <i class="layui-icon layui-icon-download-circle"></i>
                            </a>
							<a title="编辑" th:data-id="${user.id}" onclick="WeAdminEdit('编辑','admin/user/edit/page',this.getAttribute('data-id'))" href="javascript:;">
								<i class="layui-icon layui-icon-edit"></i>
							</a>
							<a title="删除" th:data-id="${user.username}" onclick="member_del(this,this.getAttribute('data-id'))" href="javascript:;">
								<i class="layui-icon layui-icon-delete"></i>
							</a>
						</td>
					</tr>
                </div>

				</tbody>
			</table>

		</div>
		<script src="lib/layui/layui.js" type="text/javascript"></script>
        <script src="js/eleDel.js" type="text/javascript"></script>
        <script>
            layui.use(['laydate', 'laypage', 'jquery'], function(){
                var laydate = layui.laydate;
                //执行一个laydate实例
                laydate.render({
                    elem: '#start', //指定元素
                    format: 'yyyy-MM-dd 00:00:00'
                });
                laydate.render({
                    elem: '#end', //指定元素
                    format: 'yyyy-MM-dd 23:59:59'
                });

            });
        </script>

	</body>

</html>